<template>
	<div class="end_box">
		<div class="end_box_header">
			<text>关于<text style="font-weight: bolder;color: #2bcddd;">{{keyword}}</text>的搜索结果如下:</text>
		</div>
		<div class="end_content">
			<div class="item" v-for="item in datalist" key="item.name">
				<div class="item_left">
					<image src="../../static/icon/logo.png"></image>
				</div>
				<div class="item_right">
					<p style="padding-left: 3%;padding-top: 3%;font-size: 17px;">{{item.name}}(
					<text v-show="item.type==0">可回收</text>
					<text v-show="item.type==1">有害</text>
					<text v-show="item.type==2">厨余(湿)</text>
					<text v-show="item.type==3">其他(干)</text>
					<text v-show="item.type==4">未知结果</text>
					垃圾)</p>
					<p style="padding-left: 3%;font-size: 12px;">{{item.contain}}</p>
					<text style="padding-left: 3%;font-size: 13px;color: red;">建议:{{item.tip}}</text> 
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return {
				keyword:"",
				datalist:[]
			}
		},
		onLoad(options) {
		    // console.log(options.value)
			this.keyword=options.value
			console.log(this.keyword)
		   
		  },
		  onReady() {
		  var that=this;
		  uni.request({
		  	url: "http://127.0.0.1:7890/zhy/news",
		  	method: "POST",
		  	data: {
		  		word: this.keyword
		  	},
		  	success(res) {
		  		
		  		that.datalist=res.data.result.list
		  		console.log(this.datalist)
		  	}
		  })

		  },
		methods:{
			
		}
	}
</script>

<style>
	.end_box{
		width: 100%;
	}
	.end_box .end_box_header{
		width: 95%;
		height: 6vh;
		line-height: 6vh;
		padding-left: 5%;
	}
	.end_box .end_content{
		width: 100%;
	
	}
	.end_box .end_content .item{
		overflow: hidden;
		width: 95%;
		height: 18vh;
		margin: 0 auto;
		box-shadow: 0px 0px 20px 10px #f8eded;
	}
	.end_box .end_content .item .item_left{
		overflow: hidden;
		width: 25%;
		height: 100%;
		display: inline-block;
	}
	.end_box .end_content .item .item_left image{
		width: 95%;
		height: 95%;
		margin-left: 5%;
	}
	.end_box .end_content .item .item_right{
		overflow: hidden;
		width: 75%;
		height: 100%;
		display: inline-block;
	}
</style>